package com.example.mapper;

import com.example.pojo.Evaluate;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EvaluateMapper {
    @Insert("insert into evaluate(name, fimage, tname, date, timage, nr, fimage_one, fimage_two, pjxj, location, id_a, id_f, id_u) values (#{name}, #{fimage}, #{tname}, #{date}, #{timage}, #{nr}, #{fimageOne}, #{fimageTwo}, #{pjxj}, #{location}, #{idA}, #{idF},#{idU})")
    void addEvaluate(Evaluate evaluate);

    @Select("select * from evaluate where id_u=#{integer} order by date desc")
    List<Evaluate> getEvaluateTenant(Integer integer);

    @Select("select * from evaluate where id_f=#{integer} order by date desc")
    List<Evaluate> getEvaluateLandlady(Integer integer);

    @Select("select * from evaluate where id_a=#{id} order by date desc")
    List<Evaluate> getEvaluateId(Integer id);
}
